package com.controller;

        import org.springframework.stereotype.Controller;
        import org.springframework.ui.Model;
        import org.springframework.ui.ModelMap;
        import org.springframework.web.bind.annotation.RequestMapping;

//注明这个是一个容器管理的bean
@Controller
public class HelloWorld {
    //注明前置分发器将url地址请求到helloWorld这个方法这里来
    @RequestMapping("/hello")
    //ModelMap,Model给jsp页面传递参数
    public String helloWorld(ModelMap map,Model model){
        model.addAttribute("hello","Model");
        //System.out.println("Hello World!");
        return "/WEB-INF/jsp/hello.jsp";
    }
}
